package com.dj.persistence.service;

import com.dj.persistence.entity.Account;

import java.util.List;
import java.math.BigDecimal;

/**
 * User: Jacob
 * Date: Jul 19, 2008
 * Time: 4:30:06 PM
 */
public interface AccountService {
    /**
     * Get the account details for this account id.
     * If no matching account is found null will be returned.
     *
     * @param id the account.
     * @return the account matching the id
     */
    public Account getAccount(Long id);

    /**
     * Returns one or more accounts matching this account number.
     * If the provided accountNo is partial, none or more than one account
     * details will be probably matched.
     *
     * @param accountNo Complete or partial account no.
     * @return a list of account details matching this account no.
     */
    public List<Account> getAccount(String accountNo);

    /**
     * Use this method to fetch accounts basedon multiple criteria.
     * Fetch all the accounts matching the account provided.
     *
     * @param account - the criterion object based on which accounts are fetched
     * @return list of account details matching provided crietria.
     */
    public List<Account> getAccountsMatching(Account account);

    /**
     * Fetch all the accounts having a balance equal or more than a spsecific amount.
     *
     * @param amount the amount passed
     * @return all the accounts having a balance equal or more than this amount.
     */
    public List<Account> getAccountsHavingBalanceEqualOrMoreThan(BigDecimal amount);
}
